! Configuration File for keepalived
global_defs {
notification_email {
lihuiyw@jd.com
}
notification_email_from lihuiyw@jd.com
smtp_server mail.jd.com
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_script check_alive
{
script "/export/sh/check_nginx_alive.sh"
interval 2
weight -10
fail 2
rise 1
}
vrrp_instance VIP_${routerid}
{
state $role
interface $interface
virtual_router_id $routerid
priority $weight
advert_int 2
garp_master_delay 10
smtp_alert
authentication
{
auth_type PASS
auth_pass 123456
}
virtual_ipaddress
{
${vip}/24
}
track_interface
{
$interface
}
track_script
{
check_alive
}
}